/**
 * 充值相关接口 
 */
var request = require('./request.js');

module.exports = {
  /**
   * 查询所有充值金额
   */
  query: function () {
    return request.get('/mbr/recharge/query')
  },
  /**
   *  创建充值订单
   */
  createOrder: function (rechangeMoneyId) {
    var params = {
      rechangeMoneyId: rechangeMoneyId
    }
    return request.post('/mbr/recharge/createOrder', params)
  },
  /**
   * 获得对应的的支付订单签名
   * @param orderId 充值单id
   * @param payMethod 支付方式
   */
  getPaySign: function (orderId, payMethod) {
    var params = {
      orderId: orderId,
      payMethod: payMethod
    }
    return request.post('/mbr/recharge/getPaySign', params);
  },
  /**
   * 查询充值明细,分页查询储值流水信息,默认全部查询
   */
  queryList: function (page, pageSize, mobile) {
    var params = {
      page: page,
      pageSize: pageSize,
      memberMobileEquals: mobile,
      orderDirection: 'desc',
      orderField: 'tranTime'
    }
    return request.get('/mbr/cardPay/query', params)
  }
}